
//Cloneable
//如果一个接口里面没有抽象方法，表示当前的接口是一个标记性接口
//现在cloneable表示一旦实现了，那么当前类的对象就可以被克隆
//如果没有实现，当前类的对象就不能克隆

public class Student implements Cloneable{
    private String name;
    private int age;
    private char gender;
    private int id;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public char getGender() {
        return gender;
    }

    public void setGender(char gender) {
        this.gender = gender;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

//    public void copy(){
//        try {
//            Object clone = this.clone();
//        } catch (CloneNotSupportedException e) {
//            throw new RuntimeException(e);
//        }
//
//    }


    //重写object中的clone方法
    @Override
    public Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
